import request from '@/utils/request'

// 查询评论-点赞列表
export function listReviewUpvote(query) {
  return request({
    url: '/forum/reviewUpvote/list',
    method: 'get',
    params: query
  })
}

// 查询评论-点赞详细
export function getReviewUpvote(id) {
  return request({
    url: '/forum/reviewUpvote/' + id,
    method: 'get'
  })
}

// 新增评论-点赞
export function addReviewUpvote(data) {
  return request({
    url: '/forum/reviewUpvote',
    method: 'post',
    data: data
  })
}

// 评论点赞-如果已点赞取消点赞，未点赞就点赞
export function isLike(data) {
  return request({
    url: '/forum/reviewUpvote/like',
    method: 'post',
    data: data
  })
}

// 评论-获取评论列表-根据用户id和帖子id
export function getLikeListForUserPost(query) {
  return request({
    url: '/forum/reviewUpvote/likeList',
    method: 'get',
    params: query
  })
}

// 修改评论-点赞
export function updateReviewUpvote(data) {
  return request({
    url: '/forum/reviewUpvote',
    method: 'put',
    data: data
  })
}

// 删除评论-点赞
export function delReviewUpvote(id) {
  return request({
    url: '/forum/reviewUpvote/' + id,
    method: 'delete'
  })
}
